
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>商用消息实现方案 - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>商用消息实现方案 - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">组件</div>
          <div class="card-question">在企业级RocketMQ架构中，NameServer集群的核心职责是什么？它在设计上有什么特点以支持水平扩展？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">组件</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">NameServer集群主要负责服务发现和路由功能。其设计特点是各个节点之间相互独立，采用无状态设计，这使得它非常便于进行水平扩展。</div>
          </div>
          <div class="card-source">来源: 核心组件</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">RocketMQ的Broker集群如何通过其架构实现跨机房容灾？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">Broker集群采用主从架构，每个Broker主节点会配备一个或多个从节点。通过将主从节点分布在不同的机房，可以实现跨机房的容灾能力。</div>
          </div>
          <div class="card-source">来源: 核心组件</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">模式</div>
          <div class="card-question">RocketMQ的Consumer集群支持哪两种主要的消息消费模式？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">模式</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">Consumer集群支持集群消费和广播消费两种模式。</div>
          </div>
          <div class="card-source">来源: 核心组件</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">架构</div>
          <div class="card-question">“多集群异地多活部署”适用于哪些场景？它依赖什么功能来实现数据同步和灾难切换？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">架构</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">这种部署模式适用于大型企业和关键业务系统。它通过RocketMQ的消息复制功能实现跨集群数据同步，并支持就近接入和灾难切换。</div>
          </div>
          <div class="card-source">来源: 部署拓扑</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">RocketMQ如何实现自动化的主从故障转移？当主节点故障时会发生什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">通过Dledger组件实现自动主从切换。当主节点发生故障时，从节点会自动升级为新的主节点，并且客户端能够自动感知这种变化，无需人工干预。</div>
          </div>
          <div class="card-source">来源: 高可用设计</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">在Broker的多副本机制中，同步复制和异步复制各有何优缺点？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">同步复制能够保证数据的强一致性，但可能会影响性能；而异步复制则能提高性能和吞吐量，但在极端情况下可能存在数据丢失的风险。</div>
          </div>
          <div class="card-source">来源: 高可用设计</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">策略</div>
          <div class="card-question">在性能优化方面，有哪些针对硬件和架构的建议？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">策略</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">硬件方面建议使用SSD存储CommitLog，配置足够的内存和高性能网卡。架构方面建议合理规划Topic和队列数量，使用消息批量发送与消费，实现消息压缩，并采用异步刷盘和异步复制来提高吞吐量。</div>
          </div>
          <div class="card-source">来源: 性能优化</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">策略</div>
          <div class="card-question">为了提高RocketMQ的写入性能，文档在硬件优化方面给出了什么具体建议？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">策略</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">建议使用SSD存储CommitLog，因为SSD能显著提高数据的写入性能。</div>
          </div>
          <div class="card-source">来源: 性能优化</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">监控RocketMQ时，哪些关键指标可以反映其消费能力和系统响应速度？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">“消息堆积量”可以反映系统的消费能力；“消息延迟”可以反映系统的响应速度。</div>
          </div>
          <div class="card-source">来源: 监控实施</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
